using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;

namespace AvaloniaApplication1.Models;

public partial class MqttMessageDataModel:ObservableObject
{
    /// <summary>
    /// 设备ID
    /// </summary>
    public string DeviceId { get; set; }
        
    /// <summary>
    /// 主题
    /// </summary>
    public string Topic { get; set; }
        
    /// <summary>
    /// 原始载荷
    /// </summary>
    public string Payload { get; set; }
        
    /// <summary>
    /// 消息时间戳
    /// </summary>
    public DateTime Timestamp { get; set; }
        
    /// <summary>
    /// 解析后的数据字典
    /// </summary>
    public Dictionary<string, object> ParsedData { get; set; }
    /// <summary>
    /// 消息类型
    /// </summary>
    public string MessageType { get; set; }
    

    public MqttMessageDataModel(string deviceId, string topic, string payload)
    {
        DeviceId = deviceId;
        Topic = topic;
        Payload = payload;
        Timestamp = DateTime.Now;
        ParsedData = new Dictionary<string, object>();
    }
}